#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <iostream>
#include "gridwidget.h"

MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    m_isRun = false;
    setFixedSize(400, 400);
}

MainWindow::~MainWindow()
{
    delete ui;
}

void MainWindow::changeEvent(QEvent *e)
{
    QMainWindow::changeEvent(e);
    switch (e->type()) {
    case QEvent::LanguageChange:
        ui->retranslateUi(this);
        break;
    default:
        break;
    }
}

void MainWindow::runOrSet(bool isRun) {
    m_isRun = isRun;
    GridWidget* g = (GridWidget*)centralWidget();
    g->toggleTimer(isRun);
}

